.class Lcom/xingbook/park/c/a/i;
.super Landroid/view/ViewGroup;


# static fields
.field public static a:I

.field public static b:I

.field public static c:I


# instance fields
.field private d:Ljava/util/ArrayList;

.field private e:Lcom/xingbook/park/c/a/g;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x5

    sput v0, Lcom/xingbook/park/c/a/i;->a:I

    sput v0, Lcom/xingbook/park/c/a/i;->b:I

    const/4 v0, 0x4

    sput v0, Lcom/xingbook/park/c/a/i;->c:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/xingbook/park/c/a/g;)V
    .locals 1

    invoke-direct {p0, p1}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;)V

    iput-object p2, p0, Lcom/xingbook/park/c/a/i;->e:Lcom/xingbook/park/c/a/g;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    return-void
.end method


# virtual methods
.method protected onLayout(ZIIII)V
    .locals 12

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    invoke-virtual {p0}, Lcom/xingbook/park/c/a/i;->getChildCount()I

    move-result v7

    const/4 v3, 0x0

    const/4 v2, 0x0

    const/4 v1, -0x1

    const/4 v0, 0x0

    move v6, v0

    move v0, v1

    :goto_0
    if-lt v6, v7, :cond_1

    const/high16 v0, 0x41f0

    iget-object v1, p0, Lcom/xingbook/park/c/a/i;->e:Lcom/xingbook/park/c/a/g;

    invoke-static {v1}, Lcom/xingbook/park/c/a/g;->a(Lcom/xingbook/park/c/a/g;)F

    move-result v1

    mul-float/2addr v0, v1

    float-to-int v0, v0

    div-int/lit8 v2, v0, 0x2

    const/4 v0, 0x0

    move v1, v0

    :goto_1
    if-lt v1, v7, :cond_13

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_14

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    iget-object v1, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    iget v0, v0, Lcom/xingbook/park/c/a/j;->d:I

    sget v1, Lcom/xingbook/park/c/a/i;->a:I

    div-int/lit8 v1, v1, 0x2

    add-int/2addr v0, v1

    :goto_2
    sub-int v1, p5, p3

    if-eq v0, v1, :cond_0

    new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;

    const/4 v2, -0x1

    invoke-direct {v1, v2, v0}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    const/high16 v0, 0x428c

    iget-object v2, p0, Lcom/xingbook/park/c/a/i;->e:Lcom/xingbook/park/c/a/g;

    invoke-static {v2}, Lcom/xingbook/park/c/a/g;->a(Lcom/xingbook/park/c/a/g;)F

    move-result v2

    mul-float/2addr v0, v2

    float-to-int v0, v0

    iput v0, v1, Landroid/widget/RelativeLayout$LayoutParams;->topMargin:I

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->e:Lcom/xingbook/park/c/a/g;

    invoke-static {v0}, Lcom/xingbook/park/c/a/g;->b(Lcom/xingbook/park/c/a/g;)Lcom/xingbook/park/c/a/i;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/xingbook/park/c/a/i;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    :cond_0
    return-void

    :cond_1
    add-int/lit8 v1, v0, 0x1

    invoke-virtual {p0, v6}, Lcom/xingbook/park/c/a/i;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    sget v0, Lcom/xingbook/park/c/a/i;->c:I

    if-ge v1, v0, :cond_2

    add-int v0, v2, v4

    sget v8, Lcom/xingbook/park/c/a/i;->b:I

    add-int/2addr v0, v8

    sub-int v8, p4, p2

    sget v9, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v9, v9, 0x2

    sub-int/2addr v8, v9

    if-le v0, v8, :cond_6

    if-lez v1, :cond_6

    :cond_2
    sub-int v0, p4, p2

    sget v8, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v8, v8, 0x2

    sub-int/2addr v0, v8

    sub-int/2addr v0, v2

    div-int/2addr v0, v1

    div-int/lit8 v8, v0, 0x2

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v9

    const/4 v0, 0x1

    move v2, v0

    :goto_3
    if-le v2, v1, :cond_4

    const/4 v0, 0x0

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    add-int v2, v4, v1

    add-int/lit8 v3, v3, 0x1

    sget v1, Lcom/xingbook/park/c/a/i;->a:I

    add-int/2addr v1, v5

    mul-int/2addr v1, v3

    sget v8, Lcom/xingbook/park/c/a/i;->a:I

    div-int/lit8 v8, v8, 0x2

    add-int/2addr v1, v8

    add-int/2addr v1, v5

    :goto_4
    new-instance v8, Lcom/xingbook/park/c/a/j;

    invoke-direct {v8, p0, v0}, Lcom/xingbook/park/c/a/j;-><init>(Lcom/xingbook/park/c/a/i;I)V

    sub-int v4, v2, v4

    iput v4, v8, Lcom/xingbook/park/c/a/j;->a:I

    sub-int v4, v1, v5

    iput v4, v8, Lcom/xingbook/park/c/a/j;->b:I

    iput v2, v8, Lcom/xingbook/park/c/a/j;->c:I

    iput v1, v8, Lcom/xingbook/park/c/a/j;->d:I

    iget-object v1, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v1, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v7, -0x1

    if-ne v6, v1, :cond_3

    add-int/lit8 v4, v0, 0x1

    const/4 v0, 0x1

    if-ne v4, v0, :cond_8

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    div-int/lit8 v0, v0, 0x4

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x2

    if-lez v0, :cond_10

    invoke-virtual {v8, v0}, Lcom/xingbook/park/c/a/j;->a(I)V

    move v0, v4

    :cond_3
    :goto_5
    add-int/lit8 v1, v6, 0x1

    move v6, v1

    goto/16 :goto_0

    :cond_4
    sub-int v0, v9, v2

    if-ltz v0, :cond_5

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    sub-int v10, v9, v2

    invoke-virtual {v0, v10}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    invoke-virtual {v0, v8}, Lcom/xingbook/park/c/a/j;->a(I)V

    :cond_5
    add-int/lit8 v0, v2, 0x1

    move v2, v0

    goto :goto_3

    :cond_6
    if-nez v6, :cond_7

    sget v0, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v0, v0, 0x2

    :goto_6
    add-int/2addr v0, v4

    add-int/2addr v2, v0

    sget v0, Lcom/xingbook/park/c/a/i;->a:I

    add-int/2addr v0, v5

    mul-int/2addr v0, v3

    sget v8, Lcom/xingbook/park/c/a/i;->a:I

    div-int/lit8 v8, v8, 0x2

    add-int/2addr v0, v8

    add-int/2addr v0, v5

    move v11, v1

    move v1, v0

    move v0, v11

    goto :goto_4

    :cond_7
    sget v0, Lcom/xingbook/park/c/a/i;->b:I

    goto :goto_6

    :cond_8
    const/4 v0, 0x2

    if-ne v4, v0, :cond_c

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    div-int/lit8 v0, v0, 0x2

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x4

    if-gez v0, :cond_9

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    mul-int/lit8 v0, v0, 0x2

    div-int/lit8 v0, v0, 0x3

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x4

    :cond_9
    if-gez v0, :cond_16

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x4

    move v1, v0

    :goto_7
    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v8

    const/4 v0, 0x1

    move v5, v0

    :goto_8
    if-le v5, v4, :cond_a

    move v0, v4

    goto :goto_5

    :cond_a
    sub-int v0, v8, v5

    if-ltz v0, :cond_b

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    sub-int v9, v8, v5

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    invoke-virtual {v0, v1}, Lcom/xingbook/park/c/a/j;->a(I)V

    :cond_b
    add-int/lit8 v0, v5, 0x1

    move v5, v0

    goto :goto_8

    :cond_c
    const/4 v0, 0x3

    if-ne v4, v0, :cond_f

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    mul-int/lit8 v0, v0, 0x3

    div-int/lit8 v0, v0, 0x4

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x6

    if-gez v0, :cond_15

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    sub-int/2addr v0, v2

    div-int/lit8 v0, v0, 0x6

    move v1, v0

    :goto_9
    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v8

    const/4 v0, 0x1

    move v5, v0

    :goto_a
    if-le v5, v4, :cond_d

    move v0, v4

    goto/16 :goto_5

    :cond_d
    sub-int v0, v8, v5

    if-ltz v0, :cond_e

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    sub-int v9, v8, v5

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    invoke-virtual {v0, v1}, Lcom/xingbook/park/c/a/j;->a(I)V

    :cond_e
    add-int/lit8 v0, v5, 0x1

    move v5, v0

    goto :goto_a

    :cond_f
    const/4 v0, 0x4

    if-ne v4, v0, :cond_10

    sub-int v0, p4, p2

    sget v1, Lcom/xingbook/park/c/a/i;->b:I

    div-int/lit8 v1, v1, 0x2

    sub-int/2addr v0, v1

    sub-int/2addr v0, v2

    div-int/lit8 v5, v0, 0x8

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v8

    const/4 v0, 0x1

    move v1, v0

    :goto_b
    if-le v1, v4, :cond_11

    :cond_10
    move v0, v4

    goto/16 :goto_5

    :cond_11
    sub-int v0, v8, v1

    if-ltz v0, :cond_12

    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    sub-int v9, v8, v1

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    invoke-virtual {v0, v5}, Lcom/xingbook/park/c/a/j;->a(I)V

    :cond_12
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_b

    :cond_13
    iget-object v0, p0, Lcom/xingbook/park/c/a/i;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/c/a/j;

    invoke-virtual {p0, v1}, Lcom/xingbook/park/c/a/i;->getChildAt(I)Landroid/view/View;

    move-result-object v3

    iget v4, v0, Lcom/xingbook/park/c/a/j;->a:I

    iget v5, v0, Lcom/xingbook/park/c/a/j;->b:I

    iget v6, v0, Lcom/xingbook/park/c/a/j;->c:I

    iget v8, v0, Lcom/xingbook/park/c/a/j;->d:I

    invoke-virtual {v3, v4, v5, v6, v8}, Landroid/view/View;->layout(IIII)V

    iget v4, v0, Lcom/xingbook/park/c/a/j;->f:I

    add-int/2addr v4, v2

    iget v0, v0, Lcom/xingbook/park/c/a/j;->f:I

    add-int/2addr v0, v2

    invoke-virtual {v3, v4, v2, v0, v2}, Landroid/view/View;->setPadding(IIII)V

    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto/16 :goto_1

    :cond_14
    sget v0, Lcom/xingbook/park/c/a/i;->a:I

    goto/16 :goto_2

    :cond_15
    move v1, v0

    goto :goto_9

    :cond_16
    move v1, v0

    goto/16 :goto_7
.end method

.method protected onMeasure(II)V
    .locals 3

    const/4 v1, 0x0

    move v0, v1

    :goto_0
    invoke-virtual {p0}, Lcom/xingbook/park/c/a/i;->getChildCount()I

    move-result v2

    if-lt v0, v2, :cond_0

    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->onMeasure(II)V

    return-void

    :cond_0
    invoke-virtual {p0, v0}, Lcom/xingbook/park/c/a/i;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2, v1, v1}, Landroid/view/View;->measure(II)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method
